<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>分享专题</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="admin.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="../module/inventory/css/admin/index.css" />
<script type="text/javascript" src="../script/jquery-1.4.4.min.js"></script>
<script language="javascript" src="../script/Calendar.js"></script>
<script type="text/javascript" src="../module/inventory/scripts/yui/yahoo-dom-event/yahoo-dom-event.js" ></script>
<script type="text/javascript" src="../module/inventory/scripts/yui/dragdrop/dragdrop-min.js" ></script>
<script type="text/javascript" src="../module/inventory/scripts/yui/calendar/calendar-min.js"></script>
<script type="text/javascript" src="../module/inventory/scripts/index.js"></script>
<script type="text/javascript" src="../script/jquery.validation.min.js"></script>
<script type="text/javascript" src="../script/Validator.js"></script>
<script src="../script/my_lightbox.js" language="javascript"></script>
</head>
<body>
    <div class="container">
        <div class="flow">
            <div class="itemtitle">
                <h3>分享专题</h3>
                <ul>
                    <li <{if $smarty.get.operation==''}>class="current"<{/if}>><a href="?m=share_special&s=share_special_list.php"><span>管理</span></a></li>
                    <li <{if $smarty.get.operation=='add'}>class="current"<{/if}>><a href="?m=share_special&s=share_special_add_edit.php&operation=add"><span>添加</span></a></li>
                    <{if $smarty.get.operation=='edit'}>
                    <li class="current"><a href="#"><span>修改</span></a></li>
                    <{/if}>
                </ul>
            </div>
        </div>
        <div class="h35"></div>
            <form name="form" id="form" method="post" onsubmit="return Validator.Validate(this,3)">
            <input name="id" type="hidden" id="id" value="<{$de.id}>">
            <table class="table">
                <thead>
                    <tr>
                        <th class="partition" colspan="99">分享专题</th>
                    </tr>
                </thead>
                <tbody>
                <tr>
                    <td width="100">标题</td>
                    <td>
                    <input name="title" id="title" type="text" class="w350" dataType="Require" msg="标题不能为空" value="<{$de.title}>"><div id="form-error" class="form-error"></div>
                    </td>
                </tr>
                
                <tr>
                    <td>专题头图</td>
                     <td>
                    <input name="pic" class="w350" type="text" id="pic" dataType="Require" msg="图片不能为空" value="<{$de.pic}>" />
                    [<a href="javascript:uploadfile('上传图片','pic',0,0,'sharespecial')">上传</a>] 
                    [<a href="javascript:preview('pic');">预览</a>]
                    [<a onclick="javascript:$('#pic').val('');" href="#">删除</a>] <span class="bz"></span>
                    </td>
                </tr>
                
                <tr>
                    <td width="100">喜欢数</td>
                    <td>
                    <input name="virtual_favorite_num" id="virtual_favorite_num" type="text" class="w100" value="<{$de.virtual_favorite_num}>"><span style="color:red;">此数值是后台人工干预的虚拟喜欢数</span>&nbsp;&nbsp;&nbsp;真实值:<span><{$de.favorite_num-$de.virtual_favorite_num}></span><div id="form-error" class="form-error"></div>
                    </td>
                </tr>
                
                <tr>
                    <td width="100">分享数</td>
                    <td>
                    <input name="virtual_share_num" id="virtual_share_num" type="text" class="w100" value="<{$de.virtual_share_num}>"><span style="color:red;">此数值是后台人工干预的虚拟分享数</span>&nbsp;&nbsp;&nbsp;真实值:<span><{$de.share_num-$de.virtual_share_num}></span><div id="form-error" class="form-error"></div>
                    </td>
                </tr>
                
                <tr>
                    <td width="100">访问数</td>
                    <td>
                    <input name="virtual_visit_num" id="virtual_visit_num" type="text" class="w100" value="<{$de.virtual_visit_num}>"><span style="color:red;">此数值是后台人工干预的虚拟访问数</span>&nbsp;&nbsp;&nbsp;真实值:<span><{$de.visit_num-$de.virtual_visit_num}></span><div id="form-error" class="form-error"></div>
                    </td>
                </tr>
                
                <tr>
                    <td>分类</td>
                    <td>
                        <select class="select"  name="cat_id" id="cat_id" dataType="Require" msg="必须指定分类">
                            <option value="">---请选择---</option>
                            <{foreach item=catName key=catId from=$catArr}>
                            <option value="<{$catId}>" <{if $catId==$de.cat_id}>selected<{/if}>>
                            <{$catName}>
                            </option>
                            <{/foreach}>
                        </select>
                        </td>
                </tr>
                
                <tr>
                    <td>展示模版</td>
                    <td>
                        <select class="select"  name="templates_id" id="templates_id" dataType="Require" msg="必须指定模板">
                            <option value="">---请选择---</option>
                            <{foreach item=list from=$de.temp}>
                            <option value="<{$list.id}>" <{if $list.id==$de.templates_id}>selected<{/if}>>
                            <{$list.title}>
                            </option>
                            <{/foreach}>
                        </select>
                        </td>
                </tr>
                <tr>
                    <td>专题内容</td>
                    <td>
                        <script charset="utf-8" src="../lib/kindeditor/kindeditor-min.js"></script>
                        
                        <script>
                        var editor;
                        KindEditor.ready(function(K) {
                            editor = K.create('textarea[name="desc"]', {
                                resizeType : 1,
                                allowPreviewEmoticons : false,
                                allowImageUpload : false,
                                langType :'<{$config.language}>',
                            });
                            K('select[name=templates_id]').bind('change',function(res) {
                                var tpl_id = $('#templates_id').val();
                                if(tpl_id>0){
                                    $.get('<{$config.weburl}>/admin/module.php?m=share_special&s=share_special_add_edit.php&act=get_special_tpl&templates_id='+tpl_id,function(res){
                                        if(res){
                                            var flag = confirm('此操作会覆盖之前已存在的内容，确认进行此操作？');
                                            if(flag){
                                                //设置文本
                                                editor.html(res);
                                            }
                                        }
                                    });
                                }
                            });
                        });
                        </script>
                        <textarea style="width:80%; height:300px" name="desc" id="desc"><{$de.desc}></textarea>
                    </td>
                </tr>

                <tr>
                    <td>展示状态</td>
                    <td>
                    <input type="radio" name="status" value="1" id="open" <{if $de.status==1}>checked="checked"<{/if}>/><label for="open">开启</label>
                     <input type="radio" name="status" value="2" id="open" <{if $de.status==2}>checked="checked"<{/if}>/><label for="open">推荐</label>
                    <input type="radio" name="status" value="0" id="close" <{if $de.status==0}>checked="checked"<{/if}>/><label for="close">关闭</label>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>
                    <input class="submit" type="submit" value="提交">
                    <input name="act" type="hidden" id="action" value="<{if !$smarty.get.editid}>save<{else}>edit<{/if}>">
                    </td>
                </tr>
                </tbody>
            </table>
            </form>
    </div>
</body>
</html>